<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //字符串切割
        var arr="meihaodeyitian"
        console.log(arr.slice(3));
        console.log(arr.slice(0,4));
        console.log(arr.slice(-3));
        console.log(arr.slice(-5,-3));
        //转为大写
        console.log(arr.toUpperCase());
        // 查询字符串
        console.log(arr.indexOf('o'));//找到返回下表找不到返回-1
        console.log(arr.includes("e"));//找到返回true找不到返回false
        //替换字符
        console.log(arr.replace("mei","bu"));
        //去除首位空格
        var list="  sqhy  "
        console.log(list.trim());
       
    </script>
</body>
</html>